#ifndef THINGPLEABSTRACTAPI_H
#define THINGPLEABSTRACTAPI_H

#include <iostream>
#include <cstdlib>
#include <Qt>
#include <QDebug>
#include <QList>
#include <QDateTime>
#include <QMessageAuthenticationCode>
#include <QEventLoop>
#include <QNetworkAccessManager>
#include <QNetworkRequest>
#include <QNetworkReply>
#include <QUrl>
#include <QUrlQuery>
#include <QString>

class ThingpleAbstractAPIClient
{
public:
    ThingpleAbstractAPIClient(const QString &client_id, const QString &client_secret);
    ThingpleAbstractAPIClient(const ThingpleAbstractAPIClient& source);

    ThingpleAbstractAPIClient& operator=(const ThingpleAbstractAPIClient& other);

    void setHostname(const QString hostname);
    void setPath(const QString path);
    void setPort(int port);
    void setCredential(const QString client_id, const QString client_secret);
    void setReaderName(const QString reader_name);

protected:
    QByteArray request(QString method, QString resource, QByteArray data);
    QByteArray get(QString resource);
    QByteArray post(QString resource, QByteArray data);

public: // For compiling purposes, change to private later
    QString _hostname;
    int _port;
    QString _path;
    QString _client_id;
    QString _client_secret;
    QString _reader_name;

};

#endif // THINGPLEABSTRACTAPI_H
